home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / portable / wdeletel.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-17  |  1.7 KB  |  75 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef    wdeleteln
  4.  
  5. #ifdef PDCDEBUG
  6. char *rcsid_wdeletel = "$Header: C:\CURSES\portable\RCS\wdeletel.c 2.1 1993/06/18 20:19:26 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   wdeleteln()    - remove line from window
  15.  
  16.   X/Open Description:
  17.      The line under the cursor in the window is deleted.  All
  18.      lines below the current line are moved up one line.  The
  19.      bottom line of the window is cleared.  The cursor position
  20.      does not change.
  21.  
  22.      NOTE: deleteln() is a macro.
  23.  
  24.   PDCurses Description:
  25.      No additional functionality.
  26.  
  27.   X/Open Return Value:
  28.      The wdeleteln() function returns OK on success and ERR on error.
  29.  
  30.   PDCurses Errors:
  31.      It is an error to pass a NULL window pointer to this routine.
  32.  
  33.   Portability:
  34.      PDCurses    int wdeleteln( WINDOW* win );
  35.      X/Open Dec '88    int wdeleteln( WINDOW* win );
  36.      BSD Curses    int wdeleteln( WINDOW* win );
  37.      SYS V Curses    int wdeleteln( WINDOW* win );
  38.  
  39. **man-end**********************************************************************/
  40.  
  41. int    wdeleteln(WINDOW *win)
  42. {
  43.     chtype    blank;
  44.     chtype*    end;
  45.     chtype*    temp;
  46.     int    y;
  47.  
  48. #ifdef PDCDEBUG
  49.     if (trace_on) PDC_debug("wdeleteln() - called\n");
  50. #endif
  51.  
  52.     if (win == (WINDOW *)NULL)
  53.         return( ERR );
  54.  
  55.     blank    = win->_blank | win->_attrs;
  56.     temp    = win->_y[win->_cury];
  57.  
  58.     for (y = win->_cury; y < win->_bmarg; y++)
  59.     {
  60.         win->_y[y]     = win->_y[y + 1];
  61.         win->_firstch[y] = 0;
  62.         win->_lastch[y] = win->_maxx - 1;
  63.     }
  64.  
  65.     win->_firstch[y]        = 0;
  66.     win->_lastch[y]        = win->_maxx - 1;
  67.     win->_y[win->_bmarg]    = temp;
  68.  
  69.     for (end = &(temp[win->_maxx - 1]); temp <= end;)
  70.     {
  71.         *temp++ = blank;
  72.     }
  73.     return( OK );
  74. }
  75.